import request from '@/config/axios'

// 项目阶段 VO
export interface ProjectStageVO {
  id: string // ID
  name: string // 阶段名称
  description: string // 阶段描述
  period: string // 时间周期
  projectId: number // 项目ID
  userId: number // 阶段负责人
}

// 项目阶段 API
export const ProjectStageApi = {
  // 查询项目阶段分页
  getProjectStagePage: async (params: any) => {
    return await request.get({ url: `/pypm/project-stage/page`, params })
  },

  // 查询项目阶段详情
  getProjectStage: async (id: number) => {
    return await request.get({ url: `/pypm/project-stage/get?id=` + id })
  },

  // 新增项目阶段
  createProjectStage: async (data: ProjectStageVO) => {
    return await request.post({ url: `/pypm/project-stage/create`, data })
  },

  // 修改项目阶段
  updateProjectStage: async (data: ProjectStageVO) => {
    return await request.put({ url: `/pypm/project-stage/update`, data })
  },

  // 删除项目阶段
  deleteProjectStage: async (id: number) => {
    return await request.delete({ url: `/pypm/project-stage/delete?id=` + id })
  },

  // 导出项目阶段 Excel
  exportProjectStage: async (params) => {
    return await request.download({ url: `/pypm/project-stage/export-excel`, params })
  }
}